package com.tarena.lbs.mapper;

import com.tarena.lbs.entity.Coupon;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CouponMapper {
    Coupon getCouponById(Integer id);
    List<Coupon> listCouponsByActivityId(Integer activityId);
    int updateCouponStock(Integer couponId, Integer num);
    /**
     * 逻辑删除优惠券
     */
    int deleteCoupon(@Param("id") Integer id);

    /**
     * 批量逻辑删除优惠券
     */
    int batchDeleteCoupons(@Param("ids") List<Integer> ids);
    int insertCoupon(Coupon coupon);
    List<Coupon> listCouponsByIds(@Param("couponIds") List<Integer> couponIds);
}